import { EventEmitter } from 'events';

/**
 * Function than tryes to cast value of named
 * regex group into number
 */
export const parseNamedRegexGroups = (groups: Record<string, string>) => (
  Object.fromEntries(
    Object.entries(groups).map(([key, value]) => (
      [key, Number(value) || value]
    ))
  )
)
